<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">

      <div>
        <!-- 搜索 -->
        <el-input v-model="query.ddbm" clearable size="small" placeholder="机构编码" style="width: 170px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <el-input v-model="query.xm" clearable size="small" placeholder="姓名" style="width: 170px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <el-input v-model="query.sfz" clearable size="small" placeholder="身份证" style="width: 170px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <rrOperation :crud="crud" />
      </div>
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="660px">
        <el-form ref="form" :inline="true" :model="form" size="small" label-width="110px">
          <el-form-item label="姓名" prop="bisZhsqSnryXm">
            <el-input v-model="form.bisZhsqSnryXm" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="身份证" prop="bisZhsqSnrySfz">
            <el-input v-model="form.bisZhsqSnrySfz" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="性别" prop="bisZhsqSnryXb">
            <el-input v-model="form.bisZhsqSnryXb" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="年龄" prop="bisZhsqNl">
            <el-input v-model="form.bisZhsqNl" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="医保卡号" prop="bisZhsqYbkh">
            <el-input v-model="form.bisZhsqYbkh" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="参保状态" prop="bisZhsqCbzt">
            <el-input v-model="form.bisZhsqCbzt" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="待遇开始日期" prop="bisZhsqDykkrq">
            <el-input v-model="form.bisZhsqDykkrq" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="待遇结束日期" prop="bisZhsqDyjsrq">
            <el-input v-model="form.bisZhsqDyjsrq" disabled style="width: 170px;" />
          </el-form-item>
          <el-form-item label="医保所属区县" prop="bisZhsqSnryYbssqxCode">
            <el-select v-model="form.bisZhsqSnryYbssqxCode" disabled filterable placeholder="请选择" style="width: 170px;">
              <el-option
                v-for="item in dict.ccstcqh"
                :key="item.id"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="ADL量表评分" prop="bisZhsqAdl">
            <el-input v-model="form.bisZhsqAdl" disabled style="width: 170px;">
              <el-button id="pipBtn" slot="append" icon="el-icon-document" title="测量ADL量表" />
            </el-input>
          </el-form-item>
          <el-form-item label="申请类别" prop="bisZhsqSqlb">
            <el-select v-model="form.bisZhsqSqlb" filterable placeholder="请选择" disabled style="width: 170px;">
              <el-option
                v-for="item in dict.sqlb"
                :key="item.id"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="申请原因">
            <el-input v-model="form.bisZhsqSqyy" disabled :rows="3" type="textarea" style="width: 470px;" />
          </el-form-item>
          <span class="demo-image__preview">
            <el-form-item label="失能老人资料">
              <div v-for="(item, index) in tempFiles" :key="index">
                <a :href="item.path2" target="_blank" style="color:blue;font-size: 12px;">
                  <span v-if="item.fjlb === 'orgAdlLiveVideo'">ADL视频</span>
                </a>
              </div>
            </el-form-item>
          </span>
          <span v-if="roleId === 547" class="demo-image__preview">
            <el-image
              v-for="item in files2"
              :key="item"
              style="width: 100px; height: 100px"
              :src="item"
              :preview-src-list="files2"
            />
          </span>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="doSave()">通 过</el-button>
          <el-button :loading="crud.status.cu === 2" type="info" @click="doOpenTh()">退 回</el-button>
          <el-button :loading="crud.status.cu === 2" type="danger" @click="doOpenBh()">驳 回</el-button>
        </div>
      </el-dialog>
      <el-dialog title="意见" :visible.sync="dialogThFormVisible" width="500px">
        <el-form>
          <el-form-item label="退回原因">
            <el-input v-model="form.vbhyy" :rows="3" type="textarea" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <el-divider content-position="left"><span style="color: red;">提示</span></el-divider>
        <span style="color: red;">退回操作，机构可以重新提交此申请</span>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogThFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="doPgth()">确 定</el-button>
        </div>
      </el-dialog>
      <el-dialog title="意见" :visible.sync="dialogBhFormVisible" width="500px">
        <el-form>
          <el-form-item label="驳回原因">
            <el-input v-model="form.vbhyy" :rows="3" type="textarea" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <el-divider content-position="left"><span style="color: red;">提示</span></el-divider>
        <span style="color: red;">驳回操作，此申请作废，机构需重新提交</span>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogBhFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="doPgbh()">确 定</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column align="center" prop="bisZhsqZt" label="申请状态" width="130">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.bisZhsqZt === '05'" effect="plain" type="">
              {{ dict.label.zhzt[scope.row.bisZhsqZt] }}
            </el-tag>
            <el-tag v-else-if="scope.row.bisZhsqZt === '00'" effect="plain" type="warning">
              {{ dict.label.zhzt[scope.row.bisZhsqZt] }}
            </el-tag>
            <el-tag v-else effect="plain" type="danger">
              {{ dict.label.zhzt[scope.row.bisZhsqZt] }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="bisHljgQymc" label="护理机构" width="130" />
        <el-table-column align="center" prop="bisZhsqHljgBm" label="定点编码" />
        <el-table-column align="center" prop="lrsj" label="申请时间" width="150" />
        <el-table-column align="center" prop="bisZhsqYbkh" label="医保卡号" width="90" />
        <el-table-column align="center" prop="bisZhsqSnryXm" label="姓名" />
        <el-table-column align="center" prop="bisZhsqSnryXb" label="性别" />
        <el-table-column align="center" prop="bisZhsqSnrySfz" label="身份证" width="150" />
        <el-table-column align="center" prop="bisZhsqCblx" label="参保类型" width="90" />
        <el-table-column align="center" prop="bisZhsqNl" label="年龄" />
        <el-table-column align="center" prop="bisZhsqDykkrq" label="待遇开始日期" width="100" />
        <el-table-column align="center" prop="bisZhsqDyjsrq" label="待遇结束日期" width="100" />
        <el-table-column align="center" prop="bisZhsqSndj" label="失能等级" width="110" />
        <el-table-column align="center" prop="bisZhsqAdl" label="ADL评分" />
        <el-table-column align="center" prop="bisZhsqSnryYbssqxName" label="统筹区" width="130" />
        <el-table-column
          fixed="right"
          label="操作"
          width="100"
        >
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="handleClick(scope.row)">评 估</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
      <!--Drawer 抽屉，隐藏ADL量表列表-->
      <el-drawer
        title="ADL量表"
        :visible.sync="adlDrawer"
        :before-close="handleClose"
        direction="rtl"
        size="100%"
      >
        <el-container style="height: 100%;">
          <el-row :gutter="10">
            <el-col :span="20">
              <el-card class="box-card">
                <el-button @click="pinp">边看边评分</el-button>
                <video
                  id="video"
                  ref="dialogVideo"
                  controls
                  class="video"
                  :src="tempUrl"
                />
              </el-card>
            </el-col>
            <!-- 字典详情列表 -->
            <el-col :span="4">
              <el-card class="box-card overflowAuto">
                <div v-for="(adlXmItem, adlXmIndex) in adlData" :key="adlXmIndex" style="margin-left: 20px;">
                  <div style="margin-bottom: 5px;">{{ adlXmItem.adlXmPx + "、" + adlXmItem.adlXmName }}</div>
                  <div>
                    <el-radio-group v-model="adlXmItem.adlXmGroup">
                      <div v-for="(adlXmxxItem, adlXmxxIndex) in adlXmItem.adlXmList" :key="adlXmxxIndex" style="margin-left: 10px; margin-bottom: 5px;">
                        <el-radio :label="adlXmxxItem.adlXmxxId" @change="handleViewfx(adlXmxxItem, adlXmIndex, adlXmItem)">{{ adlXmxxItem.adlXmxxName }}({{ adlXmxxItem.adlXmxxFs }}分)</el-radio>
                      </div>
                    </el-radio-group>
                  </div>
                </div>
                <div style="margin-bottom: 20px; margin-top: 10px; margin-left: 58%;">
                  <span>ADL量表结果评分：{{ viewfx }}分</span>
                </div>
                <div style="margin-bottom: 20px; margin-top: 10px; margin-left: 58%;">
                  <el-button @click="handleClose">关 闭</el-button>
                  <el-button type="success" @click="adlSubmit">确 认</el-button>
                </div>
              </el-card>
            </el-col>
          </el-row>
        </el-container>
      </el-drawer>
    </div>
  </div>
</template>

<script>
import crudZhsq from '@/api/business/zhsq'
import crudFile from '@/api/tools/localStorage'
import { getAdlXmxx } from '@/api/business/adlXmxx'
import { queryZpAdlResult } from '@/api/business/AdlZhsq'
import CRUD, { presenter, header, form } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'

const defaultForm = { bisZhsqId: null, bisZhsqSnryId: null, bisZhsqSnryXm: null, bisZhsqSnryXb: null, bisZhsqSnrySfz: null, bisSnryYbssqx: null, bisZhsqDykkrq: null, bisZhsqDyjsrq: null, bisZhsqXsdyq: null, bisZhsqAdl: null, bisZhsqZt: null, adlZhsqs: [], bisZhsqSqlb: null }
export default {
  name: 'Zhsq',
  components: { pagination, rrOperation },
  mixins: [presenter(), header(),
    form(function() {
      return Object.assign({ hljg: { bisHljgId: this.bisHljgId }}, defaultForm)
    })],
  dicts: ['xb', 'yjsgx', 'ccs', 'zhzt', 'ccstcqh', 'sqlb'],
  cruds() {
    return CRUD({ title: '居家照护申请', url: 'api/generalQuery/centerQueryOrgAssessZhsqxx', query: { bisHljgId: '' }, idField: 'bisZhsqId', sort: 'lrsj,desc', crudMethod: { ...crudZhsq }})
  },
  data() {
    return {
      dialogBhFormVisible: false,
      dialogThFormVisible: false,
      adlDrawer: false,
      approveDialog: false,
      selectedZhids: [],
      bisHljgId: '',
      files: [],
      tempFiles: [],
      tempUrl: '',
      adlData: [],
      roleId: 0,
      viewfx: 0,
      viewfx0: 0,
      viewfx1: 0,
      viewfx2: 0,
      viewfx3: 0,
      viewfx4: 0,
      viewfx5: 0,
      viewfx6: 0,
      viewfx7: 0,
      viewfx8: 0,
      viewfx9: 0,
      viewfx10: 0,
      viewfx11: 0,
      viewfx12: 0,
      viewfx13: 0,
      viewfx14: 0,
      viewfx15: 0,
      viewfx16: 0,
      permission: {
        add: ['admin', 'zhsq:add'],
        edit: ['admin', 'zhsq:edit'],
        del: ['admin', 'zhsq:del']
      }
    }
  },
  computed: {
    ...mapGetters([
      'user'
    ])
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    },
    /**
     * 点击修改之前校验
     * @param crud
     * @param form
     * @returns {boolean}
     */
    [CRUD.HOOK.beforeToEdit](crud, form) {
      // 清空附件列表
      this.files = []
      this.tempFiles = []
      this.form.adlZhsqs = []
      this.viewfx = 0
      this.viewfx0 = 0
      this.viewfx1 = 0
      this.viewfx2 = 0
      this.viewfx3 = 0
      this.viewfx4 = 0
      this.viewfx5 = 0
      this.viewfx6 = 0
      this.viewfx7 = 0
      this.viewfx8 = 0
      this.viewfx9 = 0
      this.viewfx10 = 0
      this.viewfx11 = 0
      this.viewfx12 = 0
      this.viewfx13 = 0
      this.viewfx14 = 0
      this.viewfx15 = 0
      this.viewfx16 = 0
      this.getFiles()
      console.log('beforeToEdit：', this.viewfx)
      return true
    },
    handleClick(obj) {
      this.crud.toEdit(obj)
    },
    /**
     * 打开ADL量表时，实时查询
     */
    getAdl() {
      this.adlDrawer = true
      this.viewfx = this.form.adlZhsqs.length === 0 ? 0 : this.viewfx
      if (this.form.adlZhsqs.length === 0) {
        if (this.form.bisZhsqNl >= 85) {
          queryZpAdlResult(this.form.bisZhsqId, this.form.bisZhsqAdlPc).then(res => {
            this.adlData = res.adlData
            console.log('getAdl:', this.adlData)
            this.adlData.map((item, index) => {
              // 项目分组
              const adlXmGroup = item.adlXmGroup
              // 项目选项列表
              const adlXmList = item.adlXmList
              for (const adlxmxx of adlXmList) {
                // 项目选项ID
                const adlXmxxId = adlxmxx.adlXmxxId
                // 项目选项分数
                const adlXmxxFs = parseInt(adlxmxx.adlXmxxFs)
                if (adlXmGroup === adlXmxxId) {
                  this.viewfx0 = index === 0 ? parseInt(adlXmxxFs) : this.viewfx0
                  this.viewfx1 = index === 1 ? parseInt(adlXmxxFs) : this.viewfx1
                  this.viewfx2 = index === 2 ? parseInt(adlXmxxFs) : this.viewfx2
                  this.viewfx3 = index === 3 ? parseInt(adlXmxxFs) : this.viewfx3
                  this.viewfx4 = index === 4 ? parseInt(adlXmxxFs) : this.viewfx4
                  this.viewfx5 = index === 5 ? parseInt(adlXmxxFs) : this.viewfx5
                  this.viewfx6 = index === 6 ? parseInt(adlXmxxFs) : this.viewfx6
                  this.viewfx7 = index === 7 ? parseInt(adlXmxxFs) : this.viewfx7
                  this.viewfx8 = index === 8 ? parseInt(adlXmxxFs) : this.viewfx8
                  this.viewfx9 = index === 9 ? parseInt(adlXmxxFs) : this.viewfx9
                  this.viewfx10 = index === 10 ? parseInt(adlXmxxFs) : this.viewfx10
                  this.viewfx11 = index === 11 ? parseInt(adlXmxxFs) : this.viewfx11
                  this.viewfx12 = index === 12 ? parseInt(adlXmxxFs) : this.viewfx12
                  this.viewfx13 = index === 13 ? parseInt(adlXmxxFs) : this.viewfx13
                  this.viewfx14 = index === 14 ? parseInt(adlXmxxFs) : this.viewfx14
                  this.viewfx15 = index === 15 ? parseInt(adlXmxxFs) : this.viewfx15
                  this.viewfx16 = index === 16 ? parseInt(adlXmxxFs) : this.viewfx16
                  this.viewfx = this.viewfx0 +
                    this.viewfx1 +
                    this.viewfx2 +
                    this.viewfx3 +
                    this.viewfx4 +
                    this.viewfx5 +
                    this.viewfx6 +
                    this.viewfx7 +
                    this.viewfx8 +
                    this.viewfx9 +
                    this.viewfx10 +
                    this.viewfx11 +
                    this.viewfx12 +
                    this.viewfx13 +
                    this.viewfx14 +
                    this.viewfx15 +
                    this.viewfx16
                  console.log(this.viewfx)
                }
              }
            })
          })
        } else {
          getAdlXmxx().then(res => {
            console.log(res)
            this.adlData = res.adlData
            this.form.bisZhsqAdlPc = res.adlPcId
          })
        }
      }
    },
    pinp() {
      document.getElementsByTagName('video')[0].requestPictureInPicture()
    },
    showSlide() {
      this.$refs.dialogVideo.play()
    },
    closeSlide() {
      this.$refs.dialogVideo.pause()
    },
    /**
     * 记录ADL量表，并计算ADL量表总分数
     */
    adlSubmit() {
      // 是否被选中
      let selected = false
      // 未被选中的项目
      let allUnSelectedName = ''
      // ADL量表总分数
      let adlfx = 0
      // 清空选中的adl量表内容
      this.form.adlZhsqs = []
      console.log('this.adlData : ', this.adlData)
      this.adlData.map((item, index) => {
        // 项目ID
        const adlXmId = item.adlXmId
        // 项目分组
        const adlXmGroup = item.adlXmGroup
        // 项目名称
        const adlXmName = item.adlXmName
        // 项目名称
        const adlXmPx = item.adlXmPx
        // 项目选项列表
        const adlXmList = item.adlXmList

        if (adlXmId === adlXmGroup) {
          selected = selected || true
          allUnSelectedName += adlXmPx + '、' + adlXmName + '<br>'
        } else {
          for (const adlxmxx of adlXmList) {
            adlxmxx.adlXmId = adlXmId
            // 项目选项ID
            const adlXmxxId = adlxmxx.adlXmxxId
            // 项目选项分数
            const adlXmxxFs = parseInt(adlxmxx.adlXmxxFs)
            if (adlXmGroup === adlXmxxId) {
              this.form.adlZhsqs.push(adlxmxx)
              adlfx += adlXmxxFs
            }
          }
        }
        // eslint-disable-next-line no-empty
      })
      console.log('总分：', this.form.adlZhsqs)
      if (selected) {
        this.$message({
          dangerouslyUseHTMLString: true,
          showClose: true,
          message: allUnSelectedName + '<br>没有被选中',
          type: 'warning'
        })
      } else {
        if (this.form.bisZhsqNl >= 85 && this.form.bisZhsqNl < 90) {
          console.log('分数：' + this.form.bisZhsqAdl)
          if (adlfx !== 100) {
            this.adlDrawer = false
            this.form.bisZhsqAdl = adlfx
            this.closeSlide()
          } else {
            this.$message({
              dangerouslyUseHTMLString: true,
              showClose: true,
              message: '大于85周岁小于90周岁的老人，ADL量表结果禁止评100分',
              type: 'warning'
            })
          }
        } else {
          this.adlDrawer = false
          this.form.bisZhsqAdl = adlfx
          this.closeSlide()
        }
      }
    },
    handleViewfx(e, index, adlXmItem) {
      this.viewfx0 = index === 0 ? parseInt(e.adlXmxxFs) : this.viewfx0
      this.viewfx1 = index === 1 ? parseInt(e.adlXmxxFs) : this.viewfx1
      this.viewfx2 = index === 2 ? parseInt(e.adlXmxxFs) : this.viewfx2
      this.viewfx3 = index === 3 ? parseInt(e.adlXmxxFs) : this.viewfx3
      this.viewfx4 = index === 4 ? parseInt(e.adlXmxxFs) : this.viewfx4
      this.viewfx5 = index === 5 ? parseInt(e.adlXmxxFs) : this.viewfx5
      this.viewfx6 = index === 6 ? parseInt(e.adlXmxxFs) : this.viewfx6
      this.viewfx7 = index === 7 ? parseInt(e.adlXmxxFs) : this.viewfx7
      this.viewfx8 = index === 8 ? parseInt(e.adlXmxxFs) : this.viewfx8
      this.viewfx9 = index === 9 ? parseInt(e.adlXmxxFs) : this.viewfx9
      this.viewfx10 = index === 10 ? parseInt(e.adlXmxxFs) : this.viewfx10
      this.viewfx11 = index === 11 ? parseInt(e.adlXmxxFs) : this.viewfx11
      this.viewfx12 = index === 12 ? parseInt(e.adlXmxxFs) : this.viewfx12
      this.viewfx13 = index === 13 ? parseInt(e.adlXmxxFs) : this.viewfx13
      this.viewfx14 = index === 14 ? parseInt(e.adlXmxxFs) : this.viewfx14
      this.viewfx15 = index === 15 ? parseInt(e.adlXmxxFs) : this.viewfx15
      this.viewfx16 = index === 16 ? parseInt(e.adlXmxxFs) : this.viewfx16
      this.viewfx = this.viewfx0 +
        this.viewfx1 +
        this.viewfx2 +
        this.viewfx3 +
        this.viewfx4 +
        this.viewfx5 +
        this.viewfx6 +
        this.viewfx7 +
        this.viewfx8 +
        this.viewfx9 +
        this.viewfx10 +
        this.viewfx11 +
        this.viewfx12 +
        this.viewfx13 +
        this.viewfx14 +
        this.viewfx15 +
        this.viewfx16
    },
    /**
     * 修改操作时，需要加载附件信息
     */
    getFiles: function() {
      crudFile.queryFileByFjlb2(this.form.bisZhsqId).then(res => {
        this.tempFiles = res
        for (let i = 0; i < res.length; i++) {
          this.files.push(res[i].path2)
          if (res[i].fjlb === 'orgAdlLiveVideo') {
            this.tempUrl = res[i].path2
          }
        }
      })
    },
    /**
     * ADL量表关闭
     * @param done
     */
    handleClose(done) {
      this.adlDrawer = false
      this.closeSlide()
    },
    /**
     * 弹出退回页面
     * @param zt
     */
    doOpenTh() {
      this.dialogThFormVisible = true
    },
    /**
     * 弹出驳回页面
     * @param zt
     */
    doOpenBh() {
      this.dialogBhFormVisible = true
    },
    /**
     * 评估退回
     * @param zt
     */
    doPgth() {
      if (this.form.vbhyy === undefined) {
        this.$notify({
          title: '请填写退回原因',
          type: 'warning',
          duration: 2500
        })
        return
      }
      this.$confirm('你确定退回吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.form.bisZhsqZt = '80'
        this.form.bz = this.form.vbhyy
        this.crud.status.edit = CRUD.STATUS.PROCESSING
        crudZhsq.checkPgPcjgzh(this.form)
          .then(res => {
            this.crud.status.edit = CRUD.STATUS.NORMAL
            this.$notify({
              title: '评估退回',
              type: 'success',
              duration: 2500
            })
            this.dialogThFormVisible = false
            this.crud.toQuery()
          })
          .catch(err => {
            this.crud.status.edit = CRUD.STATUS.PREPARED
            console.log(err)
          })
      })
    },
    /**
     * 自定义保存
     * @param zt
     */
    doPgbh() {
      if (this.form.vbhyy === undefined) {
        this.$notify({
          title: '请填写驳回原因',
          type: 'warning',
          duration: 2500
        })
        return
      }
      this.$confirm('你确定驳回吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.form.bisZhsqZt = '-4'
        this.form.bz = this.form.vbhyy
        this.crud.status.edit = CRUD.STATUS.PROCESSING
        crudZhsq.checkPgPcjgzh(this.form)
          .then(res => {
            this.crud.status.edit = CRUD.STATUS.NORMAL
            this.$notify({
              title: '评估驳回',
              type: 'success',
              duration: 2500
            })
            this.dialogBhFormVisible = false
            this.crud.toQuery()
          })
          .catch(err => {
            this.crud.status.edit = CRUD.STATUS.PREPARED
            console.log(err)
          })
      })
    },
    /**
     * 自定义保存
     * @param zt
     */
    doSave(zt) {
      /*
      if (this.form.adlZhsqs.length === 0) {
        this.$notify({
          title: '请选择ADL量表',
          type: 'warning',
          duration: 2500
        })
        return
      }*/
      this.form.bisZhsqZt = '54'
      this.crud.status.edit = CRUD.STATUS.PROCESSING
      crudZhsq.checkPgPcjgzh(this.form)
        .then(res => {
          this.crud.status.edit = CRUD.STATUS.NORMAL
          this.$notify({
            title: '评估通过',
            type: 'success',
            duration: 2500
          })
          this.crud.toQuery()
        })
        .catch(err => {
          this.crud.status.edit = CRUD.STATUS.PREPARED
          console.log(err)
        })
    }
  }
}
</script>

<style scoped>
.overflowAuto {
  overflow-y: auto;
  position: absolute;
  width: 80%;
  height: 100%;
}
.overflowAuto::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.overflowAuto::-webkit-scrollbar-thumb {
  background: rgb(224, 214, 235);
}
</style>
